let baseRouter = [{
        id: 1,
        pid: 0,
        component: 'Main',
        path: '/setting',
        meta: {
            hidden: false,
            title: "系统设置",
            target: '',
            keepAlive: false,
            icon: "setting"
        },
        redirect: '/setting/router',
    },
    {
        id: 2,
        pid: 1,
        path: '/setting/router',
        meta: {
            target: '',
            hidden: false, //在menu  是否隐藏
            title: "设置路由",
            keepAlive: false,
        },
        component: '/setting/router',
    },
    {
        id: 3,
        pid: 1,
        path: '/setting/setting',
        meta: {
            target: '',
            hidden: false, //在menu  是否隐藏
            title: "系统设置",
            keepAlive: false,
        },
        component: '/setting/setting',
    },


]

function getid() {
    baseRouter.sort((a, b) => {
        return a.id - b.id
    })
    return baseRouter[baseRouter.length - 1].id

}

console.log(getid())